package tezhongbing;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class IntegerTest {
	public static void main(String[] args) {
		Integer a = 1;
		Integer b = 1;
		Integer c = 200;
		Integer d = 200;
		System.out.println(a==b);
		System.out.println(c==d);
		
		Map<Integer, String> map = new HashMap<Integer, String>();
		map.put(new Integer(206), "aaa");
		map.put(new Integer(206), "bbb");
		System.out.println(map.get(206));
		System.out.println(map.get(new Integer(206)));
	}

	@Test
	public void test01(){
		long begin = System.currentTimeMillis();
		String s = null;
		int i = 0;
		try {
			i = Integer.parseInt(s);
		} catch (NumberFormatException e) {
			i = 9;
		}
		System.out.println(System.currentTimeMillis()-begin);
		System.out.println(i);
	}
	@Test
	public void test02(){
		long begin = System.currentTimeMillis();
		String s = null;
		int i = 0;
		if(StringUtils.isBlank(s)){
			i = 9;
		}else{
			i = Integer.parseInt(s);
		}
		System.out.println(System.currentTimeMillis()-begin);
		System.out.println(i);
	}

	@Test
	public void test03(){
		Integer aa = null;
		System.out.println(aa == 2);
	}

}
